package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.OrderRewardMapper;
import com.qj.yantaishan.domain.OrderReward;
import com.qj.yantaishan.service.IOrderRewardService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 订单优惠Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class OrderRewardServiceImpl    extends ServiceImpl<OrderRewardMapper, OrderReward>  implements IOrderRewardService
{
    @Autowired
    private OrderRewardMapper orderRewardMapper;

    /**
     * 查询订单优惠
     * 
     * @param id 订单优惠主键
     * @return 订单优惠
     */
    @Override
    public OrderReward selectOrderRewardById(Long id)
    {
        return orderRewardMapper.selectOrderRewardById(id);
    }

    /**
     * 查询订单优惠列表
     * 
     * @param orderReward 订单优惠
     * @return 订单优惠
     */
    @Override
    public List<OrderReward> selectOrderRewardList(OrderReward orderReward)
    {
        return orderRewardMapper.selectOrderRewardList(orderReward);
    }

    /**
     * 新增订单优惠
     * 
     * @param orderReward 订单优惠
     * @return 结果
     */
    @Override
    public int insertOrderReward(OrderReward orderReward)
    {
        return orderRewardMapper.insertOrderReward(orderReward);
    }

    /**
     * 修改订单优惠
     * 
     * @param orderReward 订单优惠
     * @return 结果
     */
    @Override
    public int updateOrderReward(OrderReward orderReward)
    {
        return orderRewardMapper.updateOrderReward(orderReward);
    }

    /**
     * 批量删除订单优惠
     * 
     * @param ids 需要删除的订单优惠主键
     * @return 结果
     */
    @Override
    public int deleteOrderRewardByIds(String ids)
    {
        return orderRewardMapper.deleteOrderRewardByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单优惠信息
     * 
     * @param id 订单优惠主键
     * @return 结果
     */
    @Override
    public int deleteOrderRewardById(Long id)
    {
        return orderRewardMapper.deleteOrderRewardById(id);
    }
}
